package cn.dbqn.controller;

import cn.dbqn.entity.Drugenter;
import cn.dbqn.service.DrugenterService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
public class DrugenterController {
    @Resource
    DrugenterService drugenterService;

    @RequestMapping("/listyprk")
    public String list(Model model){
        List<Drugenter> list=drugenterService.findAllYprk();
        model.addAttribute("list",list);
        return "lyear_forms_switch";
    }

    @ResponseBody
    @RequestMapping("yprkxx")
    public Object yprkxx(@RequestParam("dputno")Integer dputno){
        Drugenter yprkxx=drugenterService.yprkxx(dputno);
        return yprkxx;
    }

}
